<!--
##############################################################################################
#	Compress URL (http://code.google.com/p/compressurl)
#	Author : Abhishek Verma (vermaabhishekp@gmail.com)
#	
#	This file is part of Compress URL.
#	
#	Compress URL is free software: you can redistribute it and/or modify
#	it under the terms of the GNU General Public License as published by
#	the Free Software Foundation, either version 3 of the License, or
#	(at your option) any later version.
#	
#	Compress URL is distributed in the hope that it will be useful,
#	but WITHOUT ANY WARRANTY; without even the implied warranty of
#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#	GNU General Public License for more details.
#	
#	You should have received a copy of the GNU General Public License
#	along with Compress URL.  If not, see <http://www.gnu.org/licenses/>.
#	
# api_example.html
#
#			Demonstrates the use of javascript api.
##############################################################################################
-->
<html>
<head>
	<title>
		Compress URL API Example
	</title>

	<!-- Include the javascript API -->
	<script language="javascript" type="text/javascript" src="api.js"> </script>
	
	<!-- Start of your own Javascript -->
	<script language="javascript" type="text/javascript">
	function compress() {
		// Get the "url" and "tiny" from the input boxes
		var url = document.getElementById("url").value;
		var tiny = document.getElementById("tiny").value;
		
		// Get checked value from checkbox
		if(document.getElementById("check").checked) 
			check = "&check";
		else
			check = "";
			
		// Call api : API_compress_url( queryString, callback_function_name)
		API_compress_url("url="+url + "&tiny=" + tiny + check, "call_me_when_done");
	}
	
	function call_me_when_done(tinyedUrl) {
		// Just alert whatever is returned
		alert(tinyedUrl);
	}
	</script>
</head>

<body>
	<center>
		<h1>Compress URL Javascript Example</h1><br/>
		Url :&nbsp;&nbsp; <input type="text" id="url" /><br/><br/>
		Tiny : <input type="text" id="tiny" /><br/><br/>
		<input type="checkbox" id="check">Only check availability, dont compress<br/><br/>
		<input type="button" value="Compress"  onClick="compress();"/>
	</center>
</body>
</html>
